package util

import (
	//"RedWork/service"
	//"RedWork/util/errmsg"
	"fmt"
	"github.com/go-sql-driver/mysql"
)

func ErrHandle(err error) (IFMySQLEr bool, errR error, errcode uint16) {
	IFMySQLEr = false
	if err != nil {
		if dirveErr, ok := err.(*mysql.MySQLError); ok {
			fmt.Println("mysql err: ", dirveErr.Message)
			errcode = dirveErr.Number
			IFMySQLEr = true
		} else {
			fmt.Println("other err: ", err)
		}
	}
	return IFMySQLEr, err, errcode
}
